home *** CD-ROM | disk | FTP | other *** search
- Path: esb.bbn.com!user
- From: rshapiro@bbn.com (R Shapiro)
- Newsgroups: comp.sys.mac.programmer.codewarrior,comp.lang.c++
- Subject: using a template parameter as a qualifier -- legal or not?
- Date: Tue, 06 Feb 1996 12:58:31 -0500
- Organization: BBN
- Message-ID: <rshapiro-0602961258310001@esb.bbn.com>
- NNTP-Posting-Host: esb.bbn.com
-
- I'd like to use the formal argument to a template as the qualifier of a
- qualified typename within the template. This doesn't work in CodeWarrior
- 8, it does work in VC++ 4.0, and I can't tell from ARM whether or not it
- *should* work.
-
- Here's a more specific example:
-
- template <class OBJECT>
- class OrderedCollection {
- typedef void (OBJECT::*memberMapper)(void);
- .
- .
- .
- };
-
- I would like the typedef 'memberMapper' to refer to pointers to member
- functions (of no arguments and returning no value) of whatever class is
- specified in a given instantiation of the template.
-
- For instance, if X and Y are classes, I would expect memberMapper in
- OrderedCollection<X> to be:
-
- void (X::*memberMapper)(void)
-
-
- and memberMapper in OrderedCollection<Y> to be:
-
- void (Y::*memberMapper)(void)
-
- Should this work or not? If not, why not? If so -- this is a bug in CW8.
-
- --
- rs/rshapiro@bbn.com
-